#!/bin/bash

# Function to zip the contents of a folder
zip_folder_contents() {
  folder=$1
  zip_name="${folder}.zip"
  cd "$folder" || exit
  zip -r "../$zip_name" ./*
  cd ..
}

# Find all directories in the current directory
for folder in */; do
  # Remove trailing slash from folder name
  folder=${folder%/}
  # Exclude directories starting with __
  if [[ ! $folder == __* ]]; then
    zip_folder_contents "$folder"
  fi
done

echo "Zipping completed."
